package com.woniu.cms.settlement.core.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.cms.settlement.core.Vo.EngineeringManagementVo;
import com.woniu.cms.settlement.core.Vo.ReleaseManagementVO;
import com.woniu.cms.settlement.core.Vo.SubcontractingSettlementVO;
import com.woniu.cms.settlement.core.service.impl.SettlementAuditsServiceImpl;
import com.woniu.cms.settlement.core.service.impl.SettlementInformationServiceImpl;
import com.woniu.common.api.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;
import java.util.List;

/**
 * <p>
 * 项目信息 前端控制器
 * </p>
 *
 * @author romantic sheep
 * @since 2022-09-20
 */
@RestController
@RequestMapping("/settlement-information")
@Api(tags = "结算")
public class SettlementInformationController {
    @Autowired
    private SettlementInformationServiceImpl informationService;

    @ApiOperation("劳务分包结算")
    @GetMapping("/service")
    public Result service(){
        Page<SubcontractingSettlementVO> page2 = new Page<>();
        IPage<SubcontractingSettlementVO> service = informationService.service(page2);
        return Result.common(service);
    }

    @ApiOperation("项目分包结算")
    @GetMapping("/project")
    private Result project(){
        Page<EngineeringManagementVo> page2 = new Page<>();
        IPage<EngineeringManagementVo> project = informationService.Project(page2);
        return Result.common(project);
    }

    @ApiOperation("成本下达管理")
    @GetMapping("/releaseManagement")
    private Result release(){
        Page<ReleaseManagementVO> page2 = new Page<>();
        IPage<ReleaseManagementVO> releaseManagementVOS = informationService.releaseManagement(page2);
        return Result.common(releaseManagementVOS);
    }

    @ApiOperation("计算成本指标总费用")
    @PutMapping("/up/{id}")
    private Result up(@PathVariable("id") int id){
        int up = informationService.up(id);
        return Result.ok();
    }



}

